From 94bacaf76d0c10ec1a56ad34ddaece7e981a3ce8 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 7 Apr 2009 10:14:35 +0100 Subject: [PATCH] xend: fix leak of /local/domain/* in xenstore xenwatch thread _storeChanged() may create /local/domain/ entries in xenstore even after the domain has shutdown. Signed-off-by: Kouya Shimura --- tools/python/xen/xend/XendDomainInfo.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 644831b87d..17ed7dac11 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -1634,7 +1634,13 @@ class XendDomainInfo: if changed: # Update the domain section of the store, as this contains some # parameters derived from the VM configuration. - self._storeDomDetails() + self.refresh_shutdown_lock.acquire() + try: + state = self._stateGet() + if state not in (DOM_STATE_SHUTDOWN, DOM_STATE_HALTED,): + self._storeDomDetails() + finally: + self.refresh_shutdown_lock.release() return 1 -- 2.30.2